<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增采购订单" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-purchase-add"  class="form-horizontal">
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "销售员"/>：
    </label>
        <div class="col-sm-8"><input name="saleUserid" value="${bpmCrmPurchase.saleUserid}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售订单编号"/>：
    </label>
        <div class="col-sm-8"><input name="saleOrderNumber" value="${bpmCrmPurchase.saleOrderNumber}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "合同价格"/>：
    </label>
        <div class="col-sm-8"><input name="orderContractPrice" value="${bpmCrmPurchase.orderContractPrice}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "是否含税"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="orderIsTax" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.orderIsTax?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "是否包含运输费用"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="orderIsTransport" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.orderIsTransport?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "是否保修"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="orderIsGuarantee" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.orderIsGuarantee?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "其他"/>：
    </label>
        <div class="col-sm-8"><input name="orderOtherItem" value="${bpmCrmPurchase.orderOtherItem}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆识别号"/>：
    </label>
        <div class="col-sm-8"><input name="carVin" value="${bpmCrmPurchase.carVin}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆"/>：
    </label>
        <div class="col-sm-8"><input name="carVehicle" value="${bpmCrmPurchase.carVehicle}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "里程"/>：
    </label>
        <div class="col-sm-8"><input name="carMileage" value="${bpmCrmPurchase.carMileage}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "变速箱 "/>：</label>
        <div class="col-sm-8">
            <@form.radio name="carTranmission" dictType="sys_crm_cartranmission" value="${bpmCrmPurchase.carTranmission?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "驱动形式"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="carDrivertrain" dictType="sys_crm_cardrivertrain" value="${bpmCrmPurchase.carDrivertrain?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "车况"/>：</label>
        <div class="col-sm-8">
            <select name="carStatus" class="form-control m-b" readonly="true" disabled>
                <#list dict.getType('sys_crm_carstatus')>
                <#items as d>
                <#if d.status =='0' >
                <option  value="${d.dictValue}" text="${d.dictLabel}" <#if d.dictValue==(bpmCrmPurchase.carStatus+'')?default("") >selected = "selected"</#if>>${d.dictLabel}</option>
        </#if>
    </#items>
</#list>
</select>
</div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "最高价"/>：
</label>
    <div class="col-sm-8"><input name="channelHighestPrice" value="${bpmCrmPurchase.channelHighestPrice}" class="form-control" type="text" readonly="true"  >
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "采购来源"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="channelPurchaseSource" dictType="sys_crm_purchasesource" value="${bpmCrmPurchase.channelPurchaseSource?default('')}" readOnly="true"  />
    </div>
</div>
<div class="form-group auctionClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否公开销售"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="channelIsOpenSale" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.channelIsOpenSale?default('')}" readOnly="true"  />
    </div>
</div>
<div class="form-group auctionClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "拍卖 "/>：</label>
    <div class="col-sm-8">
        <select name="channelAuction" class="form-control m-b" readonly="true" disabled>
            <#list dict.getType('sys_auction')>
            <#items as d>
            <#if d.status =='0' >
            <option  value="${d.dictValue}" text="${d.dictLabel}" <#if d.dictValue==(bpmCrmPurchase.channelAuction+'')?default("") >selected = "selected"</#if>>${d.dictLabel}</option>
    </#if>
</#items>
</#list>
</select>
</div>
</div>
<div class="form-group auctionClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "拍卖类型"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="channelAuctionType" dictType="sys_crm_auctiontype" value="${bpmCrmPurchase.channelAuctionType?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group auctionClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "拍卖时间类型"/>：
</label>
    <div class="col-sm-8"><input name="channelAuctionTimeType" value="${bpmCrmPurchase.channelAuctionTimeType}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group auctionClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "拍卖时间"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="channelAuctionTime"  data-type="date"   value="${(bpmCrmPurchase.channelAuctionTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text" readonly="true" />
        </div>
    </div>
</div>
<div class="form-group otherClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "卖方名称"/>：
</label>
    <div class="col-sm-8"><input name="channelSellerName" value="${bpmCrmPurchase.channelSellerName}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group otherClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "卖方联系方式"/>：
</label>
    <div class="col-sm-8"><input name="channelSellerContactinfo" value="${bpmCrmPurchase.channelSellerContactinfo}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group otherClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "采购备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="channelPurchaseMemo" class="form-control" readonly="true" >${bpmCrmPurchase.channelPurchaseMemo}</textarea>
    </div>
</div>
<div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "采购专员"/>：
</label>
    <div class="col-sm-8"><input name="managerPurchaseSpecialist" value="${bpmCrmPurchase.managerPurchaseSpecialist}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "审查"/>：</label>
    <div class="col-sm-8">
        <@form.checkbox name="managerReview" dictType="sys_crm_review" value="${(bpmCrmPurchase.managerReview+'')?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "审查备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="managerReviewMemo" class="form-control" readonly="true">${bpmCrmPurchase.managerReviewMemo}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否采购"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="managerIsPurchase" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.managerIsPurchase?default('')}" readOnly="true"/>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "采购结果"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="purchaseResult" dictType="sys_result_status" value="${bpmCrmPurchase.purchaseResult?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "结果时间"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="purchaseResultTime"  data-type="date"   value="${(bpmCrmPurchase.purchaseResultTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text" readonly="true" />
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "结果备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="purchaseResultMemo" class="form-control" readonly="true" >${bpmCrmPurchase.purchaseResultMemo}</textarea>
    </div>
</div>
<#if bpmCrmPurchase.processStatus==3 >
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否入库"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="isWarehousing" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.isWarehousing?default('')}" />
    </div>
</div>
</#if>
<#if bpmCrmPurchase.processStatus!=3 >
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否入库"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="isWarehousing" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.isWarehousing?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "付款发送日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="cashierPaySentTime"  data-type="date"   value="${(bpmCrmPurchase.cashierPaySentTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text" readonly="true" />
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "付款方式"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="cashierPayMethod" dictType="sys_crm_paymethod" value="${bpmCrmPurchase.cashierPayMethod?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "证明"/>：
</label>
    <div class="col-sm-8"><input name="cashierProofFilepath" value="${bpmCrmPurchase.cashierProofFilepath}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "收据单号"/>：
</label>
    <div class="col-sm-8"><input name="cashierReceiptNumber" value="${bpmCrmPurchase.cashierReceiptNumber}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳付款备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="cashierMemo" class="form-control" readonly="true">${bpmCrmPurchase.cashierMemo}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "支付结果"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="confirmPayMethod" dictType="sys_result_status" value="${bpmCrmPurchase.confirmPayMethod?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
</label>
    <div class="col-sm-8"><input name="confirmPayAmount" value="${bpmCrmPurchase.confirmPayAmount}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "确认走账备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="confirmMemo" class="form-control" readonly="true" >${bpmCrmPurchase.confirmMemo}</textarea>
    </div>
</div>

<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "付款总额"/>：
</label>
    <div class="col-sm-8"><input name="purchasePaySum" value="${bpmCrmPurchase.purchasePaySum}" class="form-control" type="text" readonly="true" >
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="purchaseRemark" class="form-control" readonly="true" >${bpmCrmPurchase.purchaseRemark}</textarea>
    </div>
</div>
</#if>
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bpm/purchase"
    $("#form-purchase-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/add", $('#form-purchase-add').serialize());
        }
    }
    /**
     * redio 单选回调
     * @param id
     * @param data
     * @param event
     */
    function  redioCallback(id,data,event){
        if(id == "channelPurchaseSource"){
            if ($(data).is(':checked')){
                var menuType = $(event.target).val();
                if(menuType=="0"){
                    $(".auctionClass").show();
                    $(".otherClass").hide();
                }
                else if(menuType=="1"||menuType=="2"||menuType=="3"){
                    $(".auctionClass").hide();
                    $(".otherClass").show();
                }
            }
        }
    }
</script>
</@footer>
</@pageTheme>